<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>

<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>后台管理中心-文章管理</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="修改文章">
    <meta name="author" content="">
    <link rel="stylesheet" type="text/css" href="resources/lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="resources/stylesheets/theme.css">
    <link rel="stylesheet" href="resources/lib/font-awesome/css/font-awesome.css">
    <script src="resources/lib/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="resources/lib/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript">

    </script>
    <!-- 加载编辑器的容器
    <script id="myEditor" name="content" type="text/plain">
        这里写你的初始化内容
    </script>-->
    <!-- 配置文件 -->
    <script type="text/javascript" charset="utf-8" src="resources/ueditor/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" charset="utf-8" src="resources/ueditor/ueditor.all.js"></script>
    <script type="text/javascript" charset="utf-8" src="resources/ueditor/lang/zh-cn/zh-cn.js"></script>
    <!-- 实例化编辑器 -->
    <script type="text/javascript">
        var ue = UE.getEditor('myEditor',{
            initialFrameWidth :560,//设置编辑器宽度
            initialFrameHeight:400,//设置编辑器高度
            scaleEnabled:true
        });
        function addSmallPic(){
            var articleSmallPic_div = $("#articleSmallPic_div");
            articleSmallPic_div.append('<span><input type="file"class="span8" name="articleSmallPics">&nbsp;&nbsp;<a href="javascript:void(0)" onclick="removeSmallPic(this)">-</a></span>');
        }
        function removeSmallPic(_this){
            $(_this).parent().remove();
        }
    </script>
</head>


<body>

<jsp:include page="/view/common/head.jsp"></jsp:include>
<jsp:include page="/view/common/left.jsp"></jsp:include>


<div class="content">


    <ul class="breadcrumb">
        <li><a href="admin/index">主页</a> <span class="divider">/</span></li>
        <li><a href="">文章管理</a> <span class="divider">/</span></li>
        <li class="active">修改文章信息</li>
    </ul>


    <div class="row-fluid">
        <div class="dialog" style="width: 600px;height: 700px;">
            <div class="" style="width: 600px;height: 700px;">

                <div class="block-body" style="height: 600px;">
                    <form action="articleInfo/editArticleInfo" method="post" role="form" enctype="multipart/form-data">
                        <label>所属APP</label>
                        <form:select path="appType" class="form-control span8">
                            <form:options items="${articleInfo.appTypeLookups}" itemValue="itemCode" itemLabel="itemName"/>
                        </form:select>
                        <label>文章类型</label>
                        <form:select path="type" class="form-control span8">
                            <form:options items="${articleInfo.typeLookups}" itemValue="itemCode" itemLabel="itemName"/>
                        </form:select>
                        <label>排版方式</label>
                        <form:select path="setType" class="form-control span8">
                            <form:options items="${articleInfo.setTypeLookups}" itemValue="itemCode" itemLabel="itemName"/>
                        </form:select>
                        <label>标题</label>
                        <form:input path="title" type="text" class="span8"  maxlength="200"></form:input>
                        <label>缩略图</label>
                        <div id="articleSmallPic_div">
                            <input type="file"class="span8" name="articleSmallPics">&nbsp;&nbsp;<a href="javascript:void(0)" onclick="addSmallPic()">+</a>
                            <c:forEach items="${articleInfo.pictures}" var="file" varStatus="status">
                               <span><img src="${file.filePath}"/></span>
                            </c:forEach>
                        </div>
                        

                        <label>内容</label>
                        <textarea name="content" id="myEditor" rows="10">${articleInfo.content}</textarea>

                        <input type="submit"class="btn btn-primary pull-right" value="提交">

                        <div class="clearfix"></div>



                    </form>
    </div>
</div>
</div>
</div>

</div>




</body>
</html>
